/**
 * 
 */
package com.hawkfly.interceptor;

import com.wbcs.config.component.application.report.ReportBean;
import com.wbcs.jbsf.util.Consts;
import com.wbcs.jbsf.util.Wbcs4JBSFUtil;
import com.wbcs.system.ReportRequest;
import com.wbcs.system.intercept.AbsInterceptorDefaultAdapter;

/**
 * 活动预告拦截器
 * @author hawkfly
 * @project sdcmw
 */
public class ItprActiveventslst extends AbsInterceptorDefaultAdapter
{
    @Override
	public void doStart(ReportRequest rrequest,ReportBean rbean)
    {
        
        String rolename = Wbcs4JBSFUtil.getRolenames(rrequest.getRequest().getSession().getAttribute(Consts.SESSION_ROLE));
        Object siteid = rrequest.getRequest().getSession().getAttribute(Consts.SESSION_SITEID);
        Object userid = rrequest.getRequest().getSession().getAttribute(Consts.SESSION_USERID);
        
        if(!Consts.MAINSITE.equals(siteid) && rolename.indexOf("编审") != -1)//非主站编审则写入FBR信息到request attribute中
        {
            String fbrcondition = "FBR = '" + userid +"' and XWZT in ('0', '3')";
            rrequest.getRequest().setAttribute("txtfbr",fbrcondition);
        }
        else
        {           
            String fbrcondition = "FBR = '" + userid +"' or (XWZT not in ('0', '3'))";
            rrequest.getRequest().setAttribute("txtfbr",fbrcondition);
        }
    }
}

